package com.feri.rbacsys.controller;

import com.feri.rbacsys.bo.CustomAddBo;
import com.feri.rbacsys.bo.CustomBo;
import com.feri.rbacsys.service.intf.CustomService;
import com.feri.rbacsys.vo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author wmg
 * @date 2023/3/28
 * @apiNote
 */
@RestController
@RequestMapping("/api/custom/")
@Api(tags = "客户相关接口")
public class CustomController {
    @Resource
    private CustomService service;
    /**
     * 新增*/
    @PostMapping("add")
    @ApiOperation("添加客户及收货地址")
    public R add(@RequestBody CustomAddBo bo){
        return service.addCustom(bo);
    }

    @ApiOperation("根据编号查询客户")
    @GetMapping("queryone")
    public R queryByCno(String cno){
        return service.queryByCno(cno);
    }

    @ApiOperation("查询所有客户信息")
    @PostMapping("queryall")
    public R queryAll(@RequestBody CustomBo bo, int page, int size){
        return service.queryAll(bo,page,size);
    }
}
